<template>
	<div>
		<el-tabs v-model="activeName"  @tab-click="handleClick">
			<el-tab-pane label="采购进货" name="first">
				<PIn ref="PInRef"></PIn>
		    </el-tab-pane>
			<el-tab-pane label="采购退货" name="second">
				<POut ref="POutRef"></POut>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
	import PIn from './tfactorypurchaseIn.vue'
	import POut from './tfactorypurchaseOut.vue'
	export default{
		components:{
			PIn,
			POut
		},
		
		data(){
			return{
				activeName:'first'
			}
		},
		
		created() {
			this.$refs.PInRef.getDataList()
		},
		
		methods:{
			handleClick(tab,event){
				if(tab.name === 'first'){
					this.$refs.PInRef.getDataList()
				}
				else{
					this.$refs.PInRef.getDataList()
				}
			}
		}
		
	}
</script>

<style>
</style>
